using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class data_to_insert_into_viewcommandsMap : EntityTypeConfiguration<data_to_insert_into_viewcommands>
    {
        public data_to_insert_into_viewcommandsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.View, t.Object, t.CommandTitle, t.Command, t.Paramfield1, t.Paramfield2, t.Order, t.Group, t.Options });

            // Properties
            this.Property(t => t.View)
                .IsRequired()
                .HasMaxLength(46);

            this.Property(t => t.Object)
                .IsRequired()
                .HasMaxLength(39);

            this.Property(t => t.CommandTitle)
                .IsRequired()
                .HasMaxLength(47);

            this.Property(t => t.Command)
                .IsRequired()
                .HasMaxLength(45);

            this.Property(t => t.Paramfield1)
                .IsRequired()
                .HasMaxLength(39);

            this.Property(t => t.Paramfield2)
                .IsRequired()
                .HasMaxLength(48);

            this.Property(t => t.Order)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Group)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Options)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("data_to_insert_into_viewcommands");
            this.Property(t => t.View).HasColumnName("View");
            this.Property(t => t.Object).HasColumnName("Object");
            this.Property(t => t.CommandTitle).HasColumnName("CommandTitle");
            this.Property(t => t.Command).HasColumnName("Command");
            this.Property(t => t.Paramfield1).HasColumnName("Paramfield1");
            this.Property(t => t.Paramfield2).HasColumnName("Paramfield2");
            this.Property(t => t.Order).HasColumnName("Order");
            this.Property(t => t.Group).HasColumnName("Group");
            this.Property(t => t.Options).HasColumnName("Options");
        }
    }
}
